<%--
 *  File:    ApprovalNotesEdit.jsp
 *  @Author: CunZhang 
 *  Date:    2002/02/27
 *
 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>
<%@ include file="/inc/CatchError.inc" %>

<% //--------------------------------------  setting logger --%>
<%
   Category cat = Category.getInstance("jsp.UserEdit");    
%>

<% //--------------------------------------  variant and initialization --%>
<%
   String strModuleName = "BIEE";
  String statusback = "";
  if(request.getParameter("statusback") != null && request.getParameter("statusback").length() != 0)
  statusback = request.getParameter("statusback");
  String contextPath = request.getContextPath(); 
%>


<%//--------------------------------------  include files list --%>

<%@ include file="/inc/PageDefault.inc" %>
<html>
<head>
<title>ApprovalNotesEdit</title>
<PageFlow:CheckPageFlow pageName="approvalnotesedit"/>  

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="../js/FuncLib.js"></script>
<% 
String from="";
from=(String)session.getAttribute("from");
System.out.println("++++++++++++++++++++++appr0vefrom="+from);

%>
<script>
function page_done(a_str)
{
    var nSel = document.approvalnoteseditform.subjectcode.value;
    <%--[SCRIPT]  comment out by Erik Wu, 2002/3/7,now use one job  [SCRIPT]--%>
    if(a_str=="agree")
    {
      if (isAllSpace(approvalnoteseditform.nt0.value)){
        approvalnoteseditform.nt0.value = "<%= label.getLabelName("L_Agree",false)%>";
      }else{
        approvalnoteseditform.nt0.value = "<%= label.getLabelName("L_Agree",false) + label.getLabelName("L_Colon")%>"+approvalnoteseditform.nt0.value;
      }
    	document.approvalnoteseditform.actionname.value = "approvepassed";
    }else if(a_str=="deny"){
      if (isAllSpace(approvalnoteseditform.nt0.value)){
        approvalnoteseditform.nt0.value = "<%= label.getLabelName("L_Refuse",false)%>";
      }else{
        approvalnoteseditform.nt0.value = "<%= label.getLabelName("L_Refuse",false) + label.getLabelName("L_Colon")%>"+approvalnoteseditform.nt0.value;
      }
        document.approvalnoteseditform.actionname.value = "approvedenied";
    }
    else if(a_str=="disagree"){
      if (isAllSpace(approvalnoteseditform.nt0.value)){
        approvalnoteseditform.nt0.value = "<%= label.getLabelName("L_NotAgree",false)%>";
      }else{
        approvalnoteseditform.nt0.value = "<%= label.getLabelName("L_NotAgree",false) + label.getLabelName("L_Colon")%>"+approvalnoteseditform.nt0.value;
      }
        document.approvalnoteseditform.actionname.value = "approvepassed";
    }
    else if(a_str=="back"){
      if (isAllSpace(approvalnoteseditform.nt0.value)){
        approvalnoteseditform.nt0.value = "<%= label.getLabelName("L_ApproveBack",false)%>";
      }else{
        approvalnoteseditform.nt0.value = "<%= label.getLabelName("L_ApproveBack",false) + label.getLabelName("L_Colon")%>"+approvalnoteseditform.nt0.value;
      }
        document.approvalnoteseditform.actionname.value = "approveback";
    }
    if(!checkNull(document.approvalnoteseditform))
  	return;
    setValue();
    document.approvalnoteseditform.target = "_self";
    isRunning = true;
    document.approvalnoteseditform.submit();
    //page_back();

}
function setValue()
{
   var frm = document.approvalnoteseditform;
   frm.nt1.value = frm.nt0.value;
   frm.nc1.value = frm.nc0.value;
}
function page_back()
{
  history.back();
}
</script>
<%//---------------init pageFlow parameter----------------%>
<%
  HashMap user = (HashMap)session.getAttribute("userinfo");
  String strFromuserid = (user.get("userid")).toString();
  String strTransactionid = new String(pageContext.getAttribute("transactionid") + "");
  String strSubjectcode = (String) pageContext.getAttribute("subjectcode");
  String strTransactioncode = (String) pageContext.getAttribute("transactioncode");
  Integer nOrgid = new Integer((user.get("orgid")).toString());
  Integer grade = (Integer)pageContext.getAttribute("grade");
  Integer structconditionid= (Integer)pageContext.getAttribute("structconditionid");
  System.out.println("11111111111111111");
  Integer [] batchnostr= (Integer[])pageContext.getAttribute("batchnostr");
  System.out.println("22222222222222");
  String batchno = new String(pageContext.getAttribute("batchno") + "");
  System.out.println("333333333333333333333");
  String returnflag= (String)pageContext.getAttribute("returnflag");
  System.out.println("returnflag:"+returnflag);

  statusback=(String)pageContext.getAttribute("statusback");
  System.out.println("++++++++++++++++++++++statusback="+statusback);
  String strLanguageCode0;
  String strLanguageCode1;
  if(strLanguageCode.equalsIgnoreCase("cn"))
  {
	strLanguageCode0 = "cn";
	strLanguageCode1 = "en";
  }else{
	strLanguageCode0 = "en";
	strLanguageCode1 = "cn";    
  }
%>

</head>
<body>
<%--------------------------------------  hidden form variant   --%>
 <form name="approvalnoteseditform" method="post" action="<%=contextPath %>/Dispatcher">
    <input type="hidden" name="pagename" value="approvalnotesedit">
    <input type="hidden" name="actionname">
    <input type="hidden" name="languagecode" value="<%= strLanguageCode %>">
    <input type="hidden" name="from" value="<%=from%>">
    <input type="hidden" name="statusback" value="<%=statusback%>">
    <input type="hidden" name="orgid" value="<%=JspHelper.filterNull( nOrgid)%>">
   
    
    <input type="hidden" name="transactionid" value="<%=JspHelper.filterNull( strTransactionid)%>">
    <input type="hidden" name="transactioncode" value="<%=JspHelper.filterNull( strTransactioncode)%>">
    <input type="hidden" name="subjectcode" value="<%=JspHelper.filterNull( strSubjectcode)%>">
    <input type="hidden" name="fromuserid" value="<%=JspHelper.filterNull( strFromuserid)%>">
    <input type="hidden" name="begindate" value="<%=JspHelper.filterNull( new java.sql.Date(new java.util.Date().getTime()) )%>">
 
  <%  if(null!=batchnostr){for (int i =0 ;i <batchnostr.length;i++) { %>
 <input type="hidden" name="batchnostr" id="batchnostr<%=JspHelper.filterNull(i)%>" value="<%=JspHelper.filterNull( batchnostr[i])%>"  />

 <%  } }%>
    <custom:hidden name="grade" property="grade"></custom:hidden>
   
    <input type="hidden" name="structconditionid" value="<%=JspHelper.filterNull( structconditionid)%>">
    
    
    
    <input type="hidden" name="languagecode0" value="<%= strLanguageCode0 %>">
    <input type="hidden" name="languagecode1" value="<%= strLanguageCode1 %>">
    <input type="hidden" name="numrows" value="2">
    <%if (pageContext.getAttribute("ismyslip")!=null){%>
    <input type="hidden" name="ismyslip" value="<%=JspHelper.filterNull(pageContext.getAttribute("ismyslip"))%>">
    <%}else{%>
    <input type="hidden" name="ismyslip" value="Y">
    <%}%>
<table width="100%" cellspacing="0" border="0" cellpadding="0">
  <tr> 
    <td> 
      <table width="100%" cellspacing="0" cellpadding="0">
        <tr> 
          <td colspan="2" class="summary_top"></td>
        </tr>
        <tr> 
          <td colspan="2"><img src="../images/<%= strLanguageCode %>/quote.gif" width="16" height="11"> 
            <%= label.getLabelName("L_ApprovalSuggestion") %><%= label.getLabelName("L_Colon") + ""%></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr> 
    <td class="summary_top"></td>
  </tr>
  <tr> 
    <td> 
      <table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
        <tr> 
          <td class="need"><%= label.getLabelName("L_Title") %><%= label.getLabelName("L_Colon") + ""%></td>
          <td colspan="3"> 
            <input type="text" name="nt0" size="20" isnull="N" label="<%= message.getMessageDesc("VALUE_NOT_NULL", label.getLabelName("L_Title",false))%> ">
            <input type="hidden" name="nt1">
          </td>
        </tr>
        <tr> 
          <td class="td-text"><%= label.getLabelName("L_Content") %><%= label.getLabelName("L_Colon") + ""%></td>
          <td colspan="3"> 
            <textarea  cols="100" rows="6" name="nc0" ></textarea>
            <input type="hidden" name="nc1">
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr> 
    <td class="td_center">
      <a onclick="page_done('agree')"><custom:button type="1" label="L_Agree" imgsrc="Agree.gif" border="0" style="width:60"/></a>
      <a onclick="page_done('disagree')"><custom:button type="1" label="L_NotAgree" imgsrc="Agree.gif" border="0" style="width:60"/></a>
      <a onclick="page_done('deny')"><custom:button type="1" label="L_Deny" imgsrc="deny.gif" border="0" style="width:60"/></a>
   
   <a onclick="page_back();"><custom:button type="1" label="L_Back" imgsrc="back.gif" border="0" style="width:60"/></a>                  
 
    </td>
  </tr>
</table>
</form>
</body>
</html>


